﻿@model WebCore.Models.ViewModels.Account.Admin._UserListPartialViewModel
<table class="admin-list">
    <thead>
        <td>
            Tài khoản
        </td>
        <td>
            Tên 
        </td>
        <td class="name">
            Thông tin liên lạc
        </td>
        <td>
        </td>
        <td>
            Ngày sinh
        </td>
        <td>
            Ngày tạo
        </td>
        <td class="state">
            Trạng thái
        </td>
        <td>
            Vai trò
        </td>
        <td></td>
    </thead>
    @foreach (WebCore.Models.DataEntities.UserDetail item in Model.UserDetails)
    {
        WebCore.Models.DataEntities.Membership mem = WebCore.Models.DataManagers.AccountManager.GetMembership(item.UserID.Value);
        <tr>
            <td>
                @item.UserName
            </td>
            <td>
                @item.FullName
            </td>
            <td class="name">
                @item.Email
                <br />
                @item.HomeMobile @item.HomePhone
                <br />
                @item.Address
            </td>
            <td>
                @(item.Gender.Value == true ? "Nam" : "Nữ")
            </td>
            <td>
                @(item.BirthDate.HasValue ? item.BirthDate.Value.ToShortDateString() : "")
            </td>
            <td>
                @item.CreatedDate.Value.ToShortDateString()
            </td>
            <td class="state">
                <div class="@WebCore.App_Start.MyAppConfig.StateCssDictionary[item.State]">
                </div>
            </td>
            <td>
                @WebCore.Models.DataManagers.AccountManager.GetRolesInText(item.UserID.Value)
            </td>
            <td><a href="@Url.Action("UserDetail","Admin")?detailID=@item.UserDetailID.ToString()&backurl=@HttpUtility.UrlEncode(Request.RawUrl)" class="edit" ></a></td>
        </tr>
    }
</table>
